﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommonFramework.Utility;

namespace Xinkui.WebModel.Data {
    public class ShowRoomQueryData {
        protected ShowRoomQueryData() { }

        public static ShowRoomQueryData Create() {
            return new ShowRoomQueryData();
        }
        private int _companyId;
        private int _cat1;
        private int _cat2;
        private int _cat3;
        private int _pageIndex;
        private string _key;

        public int CompanyId {
            get {
                if (_companyId <= 0) {
                    _companyId = WebHelper.GetQueryStringValue<int>("identity", 1);
                }
                return _companyId;
            }
        }

        public int CategoryLevel1 {
            get {
                if (_cat1 <= 0) {
                    _cat1 = WebHelper.GetQueryStringValue<int>("cat1", 0);
                }
                return _cat1;
            }
        }

        public int CategoryLevel2 {
            get {
                if (_cat2 <= 0) {
                    _cat2 = WebHelper.GetQueryStringValue<int>("cat2", 0);
                }
                return _cat2;
            }
        }


        public int CategoryLevel3 {
            get {
                if (_cat3 <= 0) {
                    _cat3 = WebHelper.GetQueryStringValue<int>("cat3", 0);
                }
                return _cat3;
            }
        }

        public int PageIndex {
            get {
                if (_pageIndex <= 0) {
                    _pageIndex = WebHelper.GetQueryStringValue<int>("p", 1);
                }
                return _pageIndex;
            }
        }

        public string Keyword {
            get {
                if (string.IsNullOrEmpty(_key)) {
                    _key = WebHelper.GetQueryStringValue<string>("k", string.Empty);
                }
                return _key;
            }
        }

    }
}
